#!/bin/bash

cd /tmp
if [ ! -f tengine-2.1.2.tar.gz ]; then
  iMsg "开始下载安装包"
  wget http://tengine.taobao.org/download/tengine-2.1.2.tar.gz
  if [ $? -ne 0 ]; then
    eMsg "Nginx安装文件下载失败，请检查下载地址是否有效！"  
    exit
  fi
fi

iMsg "正在解压文件...."
sleep 2
tar zxvf tengine-2.1.2.tar.gz

iMsg "开始安装Nginx"
sleep 2

cd /tmp/tengine-2.1.2
./configure
make && make install

sMsg "恭喜，Nginx已安装成功！"

